package com.sky.controller.user;

import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author :  LENOVO
 * 创建时间 : 2024/6/14 17:28
 */
@RestController
@RequestMapping("/user/shop")
@Api(tags = "店铺相关")
@Slf4j
public class UserShopController {
    @Autowired
    private RedisTemplate redisTemplate;

    public static final String SHOP_STATUS = "SHOP_STATUS";

    /**
     * 获取店面状态
     *
     * @return
     */
    @GetMapping("/status")
    @ApiOperation("获取状态")
    public Result<Integer> getStatus() {
        Integer o = (Integer) redisTemplate.opsForValue().get(SHOP_STATUS);
        return Result.success(o);
    }
}